
//
//  PaperAssessmentModel.m
//  ZYOnlineSchool
//
//  Created by 毕武侠 on 2017/1/13.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperAssessmentModel.h"

@implementation PaperAssessmentModel

+ (NSDictionary *)objectClassInArray {
    return @{@"model_question"  : [PaperAssessmentCardModel class]};
}

- (void)mj_keyValuesDidFinishConvertingToObject {
    self.matrixData = [NSMutableArray arrayWithCapacity:self.model_question.count + 1];
    [self.matrixData addObject:@[@"考点", @"考点数量", @"我的得分"]];
//    [self.matrixData addObject:@[@"考点", @"考点总分", @"考点数量", @"我的得分"]];
    __block CGFloat height = 0;
    [self.model_question enumerateObjectsUsingBlock:^(PaperAssessmentCardModel *obj, NSUInteger idx, BOOL * _Nonnull stop) {
        height += 32.0f;
        
        NSUInteger row = 0;
        if (obj.ques_data.count % 5 == 0) {
            row = obj.ques_data.count / 5;
        } else {
            row = obj.ques_data.count / 5 + 1;
        }
        height += row * 56.0f;
        
//        [self.matrixData addObject:@[obj.module_name ? : @"",
//                                     obj.z_score ? : @"",
//                                     obj.sum ? : @"",
//                                     obj.d_score ? : @""]];
        [self.matrixData addObject:@[obj.module_name ? : @"",
                                     obj.sum ? : @"",
                                     obj.d_score ? : @""]];
    }];
    
    self.collectHeight = height;
}

@end
